package Demo3;

public class Test {
    public static void func1(Animal animal){
        animal.eat();
    }
    public static void run(IRunning irun){
        irun.run();
    }
    public static void swim(ISwimming iswim){
        iswim.swim();
    }
    public static void main(String[] args) {
        func1(new Dog("高飞",2));
        run(new Dog("旺财",4));
        swim(new Fish("小红",6));
        run(new Robot("小白"));
        Object object=new Dog("小黄",8);
    }
}
